<?php

/**
 * LoginForm class.
 * LoginForm is the data structure for keeping
 * user login form data. It is used by the 'login' action of 'SiteController'.
 */
class GoodsGeometryForm extends CFormModel
{
	public $geometry;
	public $gTypeId;
	public $goodsName;
	public $description;
	public $thumbPath;

	
 	/**
	 * Declares attribute labels.
	 */
	public function attributeLabels()
	{
		return array(
			'goodsName'=>'物品名称',
			'description'=>'描述',
			'thumbPath'=>'缩略图路径',
			'geometry'=>'几何模型路径',
			'gTypeId'=>'序列号',
		);
	}
	public function save(){
	    $goodsGeometry = new GoodsGeometry;
	    $goodsGeometry->geometry = $this->geometry;
	    $goodsGeometry->gTypeId = $this->gTypeId;
	    $goodsGeometry->goodsName = $this->goodsName;
		$goodsGeometry->description = $this->description;
		$goodsGeometry->thumbPath = $this->thumbPath;
		
	    return $goodsGeometry->validate() && $goodsGeometry->save();
	}
	
	public function model ($className = __CLASS__)
    {
        return GoodsGeometry::model();
    }
}
